Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.SpellCheckService=function(){Telerik.Web.UI.SpellCheckService.initializeBase(this);
this._url="Telerik.Web.UI.SpellCheckHandler.axd";
this._language="en-US";
this._configuration=null;
};
Telerik.Web.UI.SpellCheckService.prototype={spellCheck:function(a){this._sendRequest(this._getPostData("SpellCheck",a));
},addCustomWord:function(a){this._sendRequest(this._getPostData("AddCustom",a));
},_processResponse:function(d,a){var c=d.get_statusCode();
if(d.get_responseAvailable()&&200==c&&d.get_responseData().length>0){var b=d.get_object();
if(b.badWords!=null){b.badWords=eval(b.badWords);
}if(b.wordOffsets!=null){b.wordOffsets=eval(b.wordOffsets);
}this.raise_complete(d.get_object());
}else{if(d.get_timedOut()){alert("Spell Check Request time out");
}else{if(d.get_aborted()){alert("Spell Check Request aborted");
}else{if(404==c){window.alert("Web.config registration missing!\n The spellchecking functionality requires a HttpHandler registration in web.config. Please, use the control Smart Tag to add the handler automatically, or see the help for more information.\n\n"+this.get_url());
}else{if(c>0&&c!=200){window.alert("Spell Check Handler Server Error:"+c+"\n"+d.get_responseData());
}}}}}},_sendRequest:function(c,b){var a=new Sys.Net.WebRequest();
a.set_url(this.get_url());
a.set_httpVerb("POST");
a.set_body(c);
a.add_completed(Function.createDelegate(this,this._processResponse));
a.invoke();
},_getPostData:function(a,b){return"DictionaryLanguage="+this._encode(this._language)+"&Configuration="+this._encode(this._configuration)+"&CommandArgument="+this._encode(b)+"&CommandName="+a;
},_encode:function(a){var c=true;
try{var d=$telerik.isIE?document.charset:document.characterSet;
d=d+"";
if(d&&d.toLowerCase().indexOf("utf")==-1){c=false;
}}catch(b){}return(encodeURIComponent&&c)?encodeURIComponent(a):escape(a);
},initialize:function(){Telerik.Web.UI.SpellCheckService.callBaseMethod(this,"initialize");
},dispose:function(){Telerik.Web.UI.SpellCheckService.callBaseMethod(this,"dispose");
},get_url:function(){return this._url;
},set_url:function(a){this._url=a;
},get_language:function(){return this._language;
},set_language:function(a){this._language=a;
},get_configuration:function(){return this._configuration;
},set_configuration:function(a){this._configuration=a;
},add_complete:function(a){this.get_events().addHandler("complete",a);
},remove_complete:function(a){this.get_events().removeHandler("complete",a);
},raise_complete:function(a){var b=this.get_events().getHandler("complete");
if(b){if(!a){a=Sys.EventArgs.Empty;
}b(this,a);
}}};
Telerik.Web.UI.SpellCheckService.registerClass("Telerik.Web.UI.SpellCheckService",Sys.Component);
